<template>
	<view class="center">
		<view style="margin-top: 10px;"  v-for="(item, index) in dataAll" :key="index">
			<uni-card class="uni-card-list-title" title="提醒">
				<view class="uni-body">
					<uni-list :border="false">
						<uni-list-item :border="false" class="uni-card-list-item-title" title="提交人:" :rightText="item.checkUser || ''" />
						<uni-list-item :border="false" class="uni-card-list-item-title" title="提交时间:" :rightText="item.createTime || ''" />
						<uni-list-item :border="false" class="uni-card-list-item-title" title="问题描述:" :rightText="item.description || ''" />
						<uni-list-item showArrow class="uni-card-list-item-text" title="整改问题" clickable  @click="toHandel(item.id)"/>
					</uni-list>
				</view>
			</uni-card>
		</view>
	</view>
</template>

<script>
	import { post, postForm } from '../../utils/request.js';
	export default {
		data() {
			return {
				isRectify: false,
				extraIcon: {
					color: '#4cd964',
					size: '22',
					type: 'gear-filled'
				},
				hasLogin: true,
				dataAll: [],
				ucenterList: [
					{
						"title": "个人中心",
						"to": '',
						"icon": "help"
					},
					{
						"title": "关于我们",
						"to": '',
						"icon": "help"
					}, 
					{
						"title": "意见反馈",
						"to": '',
						"icon": "help"
					},
					{
						"title": "设置",
						"to": '',
						"icon": "gear"
					},
					{
						"title": "退出登录",
						"to": '',
						"icon": "help"
					},
				],
				title: '',
                searchQuery: '', // 用户的搜索输入
				userData: {
					name: 'test'
				},
				value: '',
				userInfor: uni.getStorageSync('userInfor'),
                range: [
                    { value: 0, text: "1" },
					{ value: 1, text: "2" },
					{ value: 2, text: "3" },
				],
				current: 3,
				total: 10,
				pageSize: 10,
				FormData: {
					name: '',
					code: '',
					pass: ''
				},
				infoData: [],
				single:  new Date(),
				mediaType: ['image', 'audio']
			}
		},
		onLoad() {
		},
		onShow() {
			this.getAlert();
			//this.dataAll = uni.getStorageSync('rectifyData')
			//this.checkData()
		},
		methods: {
			clickInter(){
				
			},
		getAlert() {
			this.dataAll = []
			let id = this.userInfor.userId;
			let prame = {
				userId: id
			}
			post('/problem/rectifyInform', prame)
			    .then(data => {
					if(data.code == 200) {
						this.dataAll = data.data
					} else {
						  uni.showToast({
						    icon: 'none',
						    title: data.message
						  });
					}
			    })
			    .catch(err => {
			        uni.showToast({
			           icon: 'none',
			          title: '获取数据失败，请检查接口返回'
			        });
			    });
		},
			//搜索功能
			  onSearch() {
			    // 执行搜索逻辑，比如发送请求到服务器或者过滤本地数据
			    console.log('搜索内容:', this.searchQuery);
			    // 这里可以添加实际的搜索逻辑，比如调用API或者过滤数据列表
			  },
			  viewInfor(id) {
				  uni.navigateTo({
				      url: '/pages/position/posAll/viewInfor?url=1&id=' + id // 跳转页面的路径
				  });
			  },
			  toHandel(id){
				  uni.navigateTo({
				      url: '/pages/position/handel/posHand?id=' + id // 跳转页面的路径
				  });
			  },
		    change(e) {
				this.single = e
				console.log('change事件:', this.single = e);
						},
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();
				month = month > 9 ? month : '0' + month;
				day = day > 9 ? day : '0' + day;
				return `${year}-${month}-${day}`;
			},
			maskClick(e){
				console.log('maskClick事件:', e);
			}
		}
	}
</script>

<style>
	.slot-box {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		align-items: center;
	}
	.uni-card-list-title {
		font-size: 17px;
		font-weight: 600;
	}
	.uni-card-list-item-title {
		font-size: 14px;
		color: #000;
		font-weight: 500;
		text-align: right;
	}
	.uni-card__content {
		padding: 0px !important;
	}
	.uni-card-list-item-text {
		font-weight: 600;
	}
	.uni-list-item__container {
	    position: relative;
	    display: flex;
	    flex-direction: row;
	    padding: 5px 15px;
	    padding-left: 15px;
	    flex: 1;
	}
	.uni-list-item__extra {
	    display: flex;
	    flex-direction: row;
	    justify-content: flex-end;
	    align-items: center;
	    width: 75%;
		font-weight: 300;
	}
	.uni-list-item__content-title {
	    width: 60px;
	}
	.slot-image {
		/* #ifndef APP-NVUE */
		display: block;
		/* #endif */
		margin-right: 10px;
		width: 30px;
		height: 30px;
	}
	.slot-text {
		flex: 1;
		font-size: 14px;
		color: black;
		margin-right: 10px;
	}
	.center {
		flex: 1;
		flex-direction: column;
		background-color: rgba(237, 237, 237, 0.9);
	}
</style>
